/**
 * Copyright © 2018
 * 
 */
package com.adds.lvds.service.impl.log;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.adds.lvds.core.plugin.PageView;
import com.adds.lvds.dao.impl.log.LogInfoMapper;
import com.adds.lvds.model.log.T_operation_log;

/**
 * @author: zhangjian
 * @date: 2018年7月28日 下午3:40:20
 * @desc TODO
 */
@Service("logInfoService")
public class LogInfoService {
	@Autowired
	private LogInfoMapper logInfoMapper;
	/**
	 * 录入操作历史记录
	 * 
	 * @param t_log
	 * @throws Exception
	 */
	public void addT_operation_log(T_operation_log t_log) {
		try {
			logInfoMapper.addT_operation_log(t_log);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * 分页查询显示日志记录信息
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public PageView<T_operation_log> pageT_operation_logByMap(PageView<T_operation_log> pageView,
			T_operation_log t_log) {
		Map<String, Object> map = new HashMap<>();
		try {
			map.put("paging", pageView);
			map.put("t", t_log);
			List<T_operation_log> list = logInfoMapper.pageT_operation_logByMap(map);
			pageView.setRecords(list);
		} catch (Exception e) {
		}
		return pageView;
	}
}
